home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / gcc260utilsdoc.lha / gnu / man / man1 / gawk.1 < prev    next >
Encoding:
Text File  |  1994-07-26  |  69.2 KB  |  1,452 lines

  1.  
  2.  
  3.  
  4. GAWK(1)                 Utility Commands                  GAWK(1)
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gawk - pattern scanning and processing language
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ggggaaaawwwwkkkk [ POSIX or GNU style options ] ----ffff _p_r_o_g_r_a_m-_f_i_l_e [ ---- ----  ]
  13.      file ...
  14.      ggggaaaawwwwkkkk [ POSIX or GNU style options ] [ -------- ] _p_r_o_g_r_a_m-_t_e_x_t file
  15.      ...
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _G_a_w_k is the GNU Project's implementation of the AWK program-
  19.      ming  language.   It  conforms  to  the  definition  of  the
  20.      language in the POSIX 1003.2 Command Language And  Utilities
  21.      Standard.   This version in turn is based on the description
  22.      in _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g  _L_a_n_g_u_a_g_e,  by  Aho,  Kernighan,  and
  23.      Weinberger, with the additional features defined in the Sys-
  24.      tem V Release 4 version of UNIX  _a_w_k.   _G_a_w_k  also  provides
  25.      some GNU-specific extensions.
  26.  
  27.      The command line consists of options to _g_a_w_k itself, the AWK
  28.      program text (if not supplied via the ----ffff or --------ffffiiiilllleeee options),
  29.      and values to be made available in the AAAARRRRGGGGCCCC  and  AAAARRRRGGGGVVVV  pre-
  30.      defined AWK variables.
  31.  
  32. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  33.      _G_a_w_k options may be either the traditional POSIX one  letter
  34.      options, or the GNU style long options.  POSIX style options
  35.      start with a single ``-'', while GNU long options start with
  36.      `` - -''.  GNU style long options are provided for both GNU-
  37.      specific features and for POSIX  mandated  features.   Other
  38.      implementations  of  the  AWK  language  are  likely to only
  39.      accept the traditional one letter options.
  40.  
  41.      Following the POSIX standard, _g_a_w_k-specific options are sup-
  42.      plied  via  arguments to the ----WWWW option.  Multiple ----WWWW options
  43.      may be supplied,  or  multiple  arguments  may  be  supplied
  44.      together  if  they  are  separated by commas, or enclosed in
  45.      quotes and separated by white space.   Case  is  ignored  in
  46.      arguments  to  the   ---- WWWW  option.   Each   ---- WWWW  option has a
  47.      corresponding GNU style  long  option,  as  detailed  below.
  48.      Arguments  to  GNU style long options are either joined with
  49.      the option by an ==== sign, with no intervening spaces, or they
  50.      may be provided in the next command line argument.
  51.  
  52.      _G_a_w_k accepts the following options.
  53.  
  54.      ----FFFF _f_s
  55.      --------ffffiiiieeeelllldddd----sssseeeeppppaaaarrrraaaattttoooorrrr====_f_s
  56.           Use _f_s for the input field separator (the value of  the
  57.           FFFFSSSS predefined variable).
  58.  
  59.      ----vvvv _v_a_r====_v_a_l
  60.  
  61.  
  62.  
  63. Free Software FoundationLast change: Apr 18 1994                   1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GAWK(1)                 Utility Commands                  GAWK(1)
  71.  
  72.  
  73.  
  74.      --------aaaassssssssiiiiggggnnnn====_v_a_r====_v_a_l
  75.           Assign the value _v_a_l, to the variable _v_a_r, before  exe-
  76.           cution of the program begins.  Such variable values are
  77.           available to the BBBBEEEEGGGGIIIINNNN block of an AWK program.
  78.  
  79.      ----ffff _p_r_o_g_r_a_m-_f_i_l_e
  80.      --------ffffiiiilllleeee====_p_r_o_g_r_a_m-_f_i_l_e
  81.           Read the AWK program source from the file _p_r_o_g_r_a_m-_f_i_l_e,
  82.           instead  of from the first command line argument.  Mul-
  83.           tiple ----ffff (or --------ffffiiiilllleeee) options may be used.
  84.  
  85.      ----mmmmffff====_N_N_N
  86.      ----mmmmrrrr====_N_N_N
  87.           Set various memory limits to the value _N_N_N.  The ffff flag
  88.           sets  the maximum number of fields, and the rrrr flag sets
  89.           the maximum record size.  These two flags and the   ---- mmmm
  90.           option  are from the AT&T Bell Labs research version of
  91.           UNIX _a_w_k.  They are ignored by _g_a_w_k, since _g_a_w_k has  no
  92.           pre-defined limits.
  93.      ----WWWW ccccoooommmmppppaaaatttt
  94.      --------ccccoooommmmppppaaaatttt      Run in _c_o_m_p_a_t_i_b_i_l_i_t_y mode.   In  compatibility
  95.                  mode, _g_a_w_k behaves identically to UNIX _a_w_k; none
  96.                  of the GNU-specific extensions  are  recognized.
  97.                  See GGGGNNNNUUUU EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS, below, for more information.
  98.  
  99.      ----WWWW ccccooooppppyyyylllleeeefffftttt
  100.      ----WWWW ccccooooppppyyyyrrrriiiigggghhhhtttt
  101.      --------ccccooooppppyyyylllleeeefffftttt
  102.      --------ccccooooppppyyyyrrrriiiigggghhhhtttt   Print the short version of the  GNU  copyright
  103.                  information message on the error output.
  104.  
  105.      ----WWWW hhhheeeellllpppp
  106.      ----WWWW uuuussssaaaaggggeeee
  107.      --------hhhheeeellllpppp
  108.      --------uuuussssaaaaggggeeee       Print a relatively short summary of the avail-
  109.                  able  options  on the error output.  Per the GNU
  110.                  Coding Standards, these options cause an immedi-
  111.                  ate, successful exit.
  112.  
  113.      ----WWWW lllliiiinnnntttt
  114.      --------lllliiiinnnntttt        Provide warnings  about  constructs  that  are
  115.                  dubious or non-portable to other AWK implementa-
  116.                  tions.
  117.      ----WWWW ppppoooossssiiiixxxx
  118.      --------ppppoooossssiiiixxxx       This turns on  _c_o_m_p_a_t_i_b_i_l_i_t_y  mode,  with  the
  119.                  following additional restrictions:
  120.  
  121.                  +o  \\\\xxxx escape sequences are not recognized.
  122.  
  123.                  +o  The synonym ffffuuuunnnncccc for the keyword ffffuuuunnnnccccttttiiiioooonnnn  is
  124.                    not recognized.
  125.  
  126.  
  127.  
  128.  
  129. Free Software FoundationLast change: Apr 18 1994                   2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GAWK(1)                 Utility Commands                  GAWK(1)
  137.  
  138.  
  139.  
  140.                  +o  The operators ******** and ********==== cannot  be  used  in
  141.                    place of ^^^^ and ^^^^====.
  142.  
  143.      ----WWWW ssssoooouuuurrrrcccceeee====_p_r_o_g_r_a_m-_t_e_x_t
  144.      --------ssssoooouuuurrrrcccceeee====_p_r_o_g_r_a_m-_t_e_x_t
  145.                  Use _p_r_o_g_r_a_m-_t_e_x_t as  AWK  program  source  code.
  146.                  This  option  allows  the  easy  intermixing  of
  147.                  library functions (used via the ----ffff and  ---- ---- ffffiiiilllleeee
  148.                  options) with source code entered on the command
  149.                  line.  It is intended primarily  for  medium  to
  150.                  large size AWK programs used in shell scripts.
  151.                  The ----WWWW ssssoooouuuurrrrcccceeee==== form of this option uses the rest
  152.                  of  the  command line argument for _p_r_o_g_r_a_m-_t_e_x_t;
  153.                  no other options to ----WWWW will be recognized in the
  154.                  same argument.
  155.  
  156.      ----WWWW vvvveeeerrrrssssiiiioooonnnn
  157.      --------vvvveeeerrrrssssiiiioooonnnn     Print version information for this  particular
  158.                  copy  of _g_a_w_k on the error output.  This is use-
  159.                  ful mainly for knowing if the  current  copy  of
  160.                  _g_a_w_k  on  your system is up to date with respect
  161.                  to whatever the Free Software Foundation is dis-
  162.                  tributing.   Per the GNU Coding Standards, these
  163.                  options cause an immediate, successful exit.
  164.  
  165.      --------            Signal the end of options. This is  useful  to
  166.                  allow  further  arguments  to  the  AWK  program
  167.                  itself to start with a ``-''.   This  is  mainly
  168.                  for  consistency  with the argument parsing con-
  169.                  vention used by most other POSIX programs.
  170.  
  171.      In compatibility mode, any  other  options  are  flagged  as
  172.      illegal, but are otherwise ignored.  In normal operation, as
  173.      long as program text has been supplied, unknown options  are
  174.      passed  on to the AWK program in the AAAARRRRGGGGVVVV array for process-
  175.      ing.  This is particularly useful for running  AWK  programs
  176.      via the ``#!'' executable interpreter mechanism.
  177.  
  178. AAAAWWWWKKKK PPPPRRRROOOOGGGGRRRRAAAAMMMM EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN
  179.      An AWK program consists  of  a  sequence  of  pattern-action
  180.      statements and optional function definitions.
  181.  
  182.           _p_a_t_t_e_r_n   {{{{ _a_c_t_i_o_n _s_t_a_t_e_m_e_n_t_s }}}}
  183.           ffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e((((_p_a_r_a_m_e_t_e_r _l_i_s_t)))) {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  184.  
  185.      _G_a_w_k first reads the program source from the _p_r_o_g_r_a_m-_f_i_l_e(s)
  186.      if  specified,  from  arguments  to  ----WWWW ssssoooouuuurrrrcccceeee====, or from the
  187.      first non-option argument on the command line.  The ----ffff and ----
  188.      WWWW  ssssoooouuuurrrrcccceeee==== options may be used multiple times on the command
  189.      line.  _G_a_w_k will  read  the  program  text  as  if  all  the
  190.      _p_r_o_g_r_a_m-_f_i_l_es  and  command  line source texts had been con-
  191.      catenated together.  This is useful for  building  libraries
  192.  
  193.  
  194.  
  195. Free Software FoundationLast change: Apr 18 1994                   3
  196.  
  197.  
  198.  
  199.  
  200. GAWK(1)                 Utility Commands                  GAWK(1)
  201.  
  202.  
  203.  
  204.      of AWK functions, without having to include them in each new
  205.      AWK program that uses them.  It also provides the ability to
  206.      mix library functions with command line programs.
  207.  
  208.      The environment variable AAAAWWWWKKKKPPPPAAAATTTTHHHH specifies a search path  to
  209.      use  when finding source files named with the ----ffff option.  If
  210.      this  variable  does  not  exist,  the   default   path   is
  211.      """"....::::////llllooooccccaaaallll////lllliiiibbbb////aaaawwwwkkkk::::////ggggnnnnuuuu////lllliiiibbbb////aaaawwwwkkkk"""".   If  a  file name given to
  212.      the ----ffff option contains a ``/'' character, no path search  is
  213.      performed.
  214.  
  215.      _G_a_w_k executes AWK programs in the following  order.   First,
  216.      all  variable  assignments  specified  via the ----vvvv option are
  217.      performed.  Next, _g_a_w_k compiles the program into an internal
  218.      form.   Then,  _g_a_w_k  executes the code in the BBBBEEEEGGGGIIIINNNN block(s)
  219.      (if any), and then proceeds to read each file named  in  the
  220.      AAAARRRRGGGGVVVV  array.   If  there  are  no files named on the command
  221.      line, _g_a_w_k reads the standard input.
  222.  
  223.      If a filename on the command line has the form _v_a_r====_v_a_l it is
  224.      treated  as  a variable assignment. The variable _v_a_r will be
  225.      assigned the value  _v_a_l.   (This  happens  after  any  BBBBEEEEGGGGIIIINNNN
  226.      block(s)  have  been run.)  Command line variable assignment
  227.      is most useful for dynamically assigning values to the vari-
  228.      ables  AWK  uses  to control how input is broken into fields
  229.      and records. It is also useful for controlling state if mul-
  230.      tiple passes are needed over a single data file.
  231.  
  232.      If the value of a particular element of AAAARRRRGGGGVVVV is empty  (""""""""),
  233.      _g_a_w_k skips over it.
  234.  
  235.      For each line in the input, _g_a_w_k tests to see if it  matches
  236.      any  _p_a_t_t_e_r_n  in the AWK program.  For each pattern that the
  237.      line matches, the associated _a_c_t_i_o_n is executed.   The  pat-
  238.      terns are tested in the order they occur in the program.
  239.  
  240.      Finally, after all the input is exhausted, _g_a_w_k executes the
  241.      code in the EEEENNNNDDDD block(s) (if any).
  242.  
  243. VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS AAAANNNNDDDD FFFFIIIIEEEELLLLDDDDSSSS
  244.      AWK variables are dynamic; they  come  into  existence  when
  245.      they  are first used. Their values are either floating-point
  246.      numbers or strings, or both, depending  upon  how  they  are
  247.      used.  AWK also has one dimensional arrays; arrays with mul-
  248.      tiple dimensions  may  be  simulated.   Several  pre-defined
  249.      variables are set as a program runs; these will be described
  250.      as needed and summarized below.
  251.  
  252.   FFFFiiiieeeellllddddssss
  253.      As each input line  is  read,  _g_a_w_k  splits  the  line  into
  254.      _f_i_e_l_d_s,  using  the  value  of  the FFFFSSSS variable as the field
  255.      separator.   If  FFFFSSSS  is  a  single  character,  fields   are
  256.  
  257.  
  258.  
  259. Free Software FoundationLast change: Apr 18 1994                   4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. GAWK(1)                 Utility Commands                  GAWK(1)
  267.  
  268.  
  269.  
  270.      separated  by  that character.  Otherwise, FFFFSSSS is expected to
  271.      be a full regular expression.  In the special case  that  FFFFSSSS
  272.      is  a  single  blank, fields are separated by runs of blanks
  273.      and/or tabs.  Note that the value of IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE (see  below)
  274.      will  also  affect how fields are split when FFFFSSSS is a regular
  275.      expression.
  276.  
  277.      If the FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS variable is set to a space separated list
  278.      of  numbers, each field is expected to have fixed width, and
  279.      _g_a_w_k will split up the record using  the  specified  widths.
  280.      The  value  of  FFFFSSSS  is ignored.  Assigning a new value to FFFFSSSS
  281.      overrides the use of FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS, and restores  the  default
  282.      behavior.
  283.  
  284.      Each field in the input line may be referenced by its  posi-
  285.      tion, $$$$1111, $$$$2222, and so on.  $$$$0000 is the whole line. The value of
  286.      a field may be assigned to as  well.   Fields  need  not  be
  287.      referenced by constants:
  288.  
  289.           nnnn ==== 5555
  290.           pppprrrriiiinnnntttt $$$$nnnn
  291.  
  292.      prints the fifth field in the input line.  The  variable  NNNNFFFF
  293.      is set to the total number of fields in the input line.
  294.  
  295.      References to non-existent fields (i.e.  fields  after  $$$$NNNNFFFF)
  296.      produce  the  null-string.  However,  assigning  to  a  non-
  297.      existent field (e.g., $$$$((((NNNNFFFF++++2222)))) ==== 5555) will increase  the  value
  298.      of NNNNFFFF, create any intervening fields with the null string as
  299.      their value, and cause the value of  $$$$0000  to  be  recomputed,
  300.      with the fields being separated by the value of OOOOFFFFSSSS.  Refer-
  301.      ences to negative numbered fields cause a fatal error.
  302.  
  303.   BBBBuuuuiiiilllltttt----iiiinnnn VVVVaaaarrrriiiiaaaabbbblllleeeessss
  304.      AWK's built-in variables are:
  305.  
  306.      AAAARRRRGGGGCCCC        The number of command line arguments  (does  not
  307.                  include options to _g_a_w_k, or the program source).
  308.  
  309.      AAAARRRRGGGGIIIINNNNDDDD      The index in AAAARRRRGGGGVVVV of the current file being pro-
  310.                  cessed.
  311.  
  312.      AAAARRRRGGGGVVVV        Array of command line arguments.  The  array  is
  313.                  indexed  from 0 to AAAARRRRGGGGCCCC - 1.  Dynamically chang-
  314.                  ing the contents of AAAARRRRGGGGVVVV can control  the  files
  315.                  used for data.
  316.  
  317.      CCCCOOOONNNNVVVVFFFFMMMMTTTT     The conversion format for  numbers,  """"%%%%....6666gggg"""",  by
  318.                  default.
  319.  
  320.      EEEENNNNVVVVIIIIRRRROOOONNNN     An array containing the values  of  the  current
  321.                  environment.    The  array  is  indexed  by  the
  322.  
  323.  
  324.  
  325. Free Software FoundationLast change: Apr 18 1994                   5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332. GAWK(1)                 Utility Commands                  GAWK(1)
  333.  
  334.  
  335.  
  336.                  environment variables, each  element  being  the
  337.                  value  of  that  variable (e.g., EEEENNNNVVVVIIIIRRRROOOONNNN[[[[""""HHHHOOOOMMMMEEEE""""]]]]
  338.                  might be ////uuuu////aaaarrrrnnnnoooolllldddd).  Changing this  array  does
  339.                  not  affect  the  environment  seen  by programs
  340.                  which _g_a_w_k spawns via redirection  or  the  ssssyyyyssss----
  341.                  tttteeeemmmm(((())))  function.   (This  may change in a future
  342.                  version of _g_a_w_k.)
  343.  
  344.      EEEERRRRRRRRNNNNOOOO       If a system error occurs either doing a redirec-
  345.                  tion  for ggggeeeettttlllliiiinnnneeee, during a read for ggggeeeettttlllliiiinnnneeee, or
  346.                  during a cccclllloooosssseeee(((()))),  then  EEEERRRRRRRRNNNNOOOO  will  contain  a
  347.                  string describing the error.
  348.  
  349.      FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS A white-space  separated  list  of  fieldwidths.
  350.                  When  set,  _g_a_w_k parses the input into fields of
  351.                  fixed width, instead of using the value  of  the
  352.                  FFFFSSSS  variable  as the field separator.  The fixed
  353.                  field  width  facility  is  still  experimental;
  354.                  expect  the  semantics to change as _g_a_w_k evolves
  355.                  over time.
  356.  
  357.      FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE    The name of the current input file.  If no files
  358.                  are  specified on the command line, the value of
  359.                  FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE is ``-''.  However, FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE  is  unde-
  360.                  fined inside the BBBBEEEEGGGGIIIINNNN block.
  361.  
  362.      FFFFNNNNRRRR         The input record number  in  the  current  input
  363.                  file.
  364.  
  365.      FFFFSSSS          The input field separator, a blank by default.
  366.  
  367.      IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE  Controls the  case-sensitivity  of  all  regular
  368.                  expression  operations. If IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE has a non-
  369.                  zero value,  then  pattern  matching  in  rules,
  370.                  field  splitting  with  FFFFSSSS,  regular  expression
  371.                  matching with ~~~~ and !!!!~~~~, and the ggggssssuuuubbbb(((()))), iiiinnnnddddeeeexxxx(((()))),
  372.                  mmmmaaaattttcccchhhh(((()))),  sssspppplllliiiitttt(((()))),  and  ssssuuuubbbb(((()))) pre-defined func-
  373.                  tions will all ignore case  when  doing  regular
  374.                  expression  operations.   Thus, if IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE is
  375.                  not equal to  zero,  ////aaaaBBBB////  matches  all  of  the
  376.                  strings """"aaaabbbb"""", """"aaaaBBBB"""", """"AAAAbbbb"""", and """"AAAABBBB"""".  As with all
  377.                  AWK variables, the initial value  of  IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE
  378.                  is  zero,  so  all regular expression operations
  379.                  are normally case-sensitive.
  380.  
  381.      NNNNFFFF          The  number  of  fields  in  the  current  input
  382.                  record.
  383.  
  384.      NNNNRRRR          The total number of input records seen so far.
  385.  
  386.      OOOOFFFFMMMMTTTT        The  output  format  for  numbers,  """"%%%%....6666gggg"""",   by
  387.                  default.
  388.  
  389.  
  390.  
  391. Free Software FoundationLast change: Apr 18 1994                   6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. GAWK(1)                 Utility Commands                  GAWK(1)
  399.  
  400.  
  401.  
  402.      OOOOFFFFSSSS         The output field separator, a blank by default.
  403.  
  404.      OOOORRRRSSSS         The output record separator, by default  a  new-
  405.                  line.
  406.  
  407.      RRRRSSSS          The input record separator, by  default  a  new-
  408.                  line.   RRRRSSSS is exceptional in that only the first
  409.                  character  of  its  string  value  is  used  for
  410.                  separating  records.  (This will probably change
  411.                  in a future release of _g_a_w_k.)  If RRRRSSSS is  set  to
  412.                  the  null  string, then records are separated by
  413.                  blank lines.  When RRRRSSSS is set to the null string,
  414.                  then  the  newline  character  always  acts as a
  415.                  field separator, in addition to  whatever  value
  416.                  FFFFSSSS may have.
  417.  
  418.      RRRRSSSSTTTTAAAARRRRTTTT      The index of  the  first  character  matched  by
  419.                  mmmmaaaattttcccchhhh(((()))); 0 if no match.
  420.  
  421.      RRRRLLLLEEEENNNNGGGGTTTTHHHH     The length of the string matched by mmmmaaaattttcccchhhh(((()))); - 1
  422.                  if no match.
  423.  
  424.      SSSSUUUUBBBBSSSSEEEEPPPP      The character used  to  separate  multiple  sub-
  425.                  scripts in array elements, by default """"\\\\000033334444"""".
  426.  
  427.   AAAArrrrrrrraaaayyyyssss
  428.      Arrays are subscripted with  an  expression  between  square
  429.      brackets ([[[[ and ]]]]).  If the expression is an expression list
  430.      (_e_x_p_r, _e_x_p_r ...)  then the array subscript is a string  con-
  431.      sisting  of  the concatenation of the (string) value of each
  432.      expression, separated by the value of the  SSSSUUUUBBBBSSSSEEEEPPPP  variable.
  433.      This  facility  is  used  to  simulate  multiply dimensioned
  434.      arrays. For example:
  435.  
  436.           iiii ==== """"AAAA"""" ;;;; jjjj ==== """"BBBB"""" ;;;; kkkk ==== """"CCCC""""
  437.           xxxx[[[[iiii,,,, jjjj,,,, kkkk]]]] ==== """"hhhheeeelllllllloooo,,,, wwwwoooorrrrlllldddd\\\\nnnn""""
  438.  
  439.      assigns the string """"hhhheeeelllllllloooo,,,, wwwwoooorrrrlllldddd\\\\nnnn"""" to the  element  of  the
  440.      array  xxxx  which  is indexed by the string """"AAAA\\\\000033334444BBBB\\\\000033334444CCCC"""". All
  441.      arrays in  AWK  are  associative,  i.e.  indexed  by  string
  442.      values.
  443.  
  444.      The special operator iiiinnnn may be used in an iiiiffff or wwwwhhhhiiiilllleeee state-
  445.      ment to see if an array has an index consisting of a partic-
  446.      ular value.
  447.  
  448.           iiiiffff ((((vvvvaaaallll iiiinnnn aaaarrrrrrrraaaayyyy))))
  449.                pppprrrriiiinnnntttt aaaarrrrrrrraaaayyyy[[[[vvvvaaaallll]]]]
  450.  
  451.      If the array has multiple subscripts, use ((((iiii,,,, jjjj)))) iiiinnnn aaaarrrrrrrraaaayyyy.
  452.  
  453.  
  454.  
  455.  
  456.  
  457. Free Software FoundationLast change: Apr 18 1994                   7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464. GAWK(1)                 Utility Commands                  GAWK(1)
  465.  
  466.  
  467.  
  468.      The iiiinnnn construct may also be used in a ffffoooorrrr loop  to  iterate
  469.      over all the elements of an array.
  470.  
  471.      An element may be deleted from an  array  using  the  ddddeeeelllleeeetttteeee
  472.      statement.   The ddddeeeelllleeeetttteeee statement may also be used to delete
  473.      the entire contents of an array.
  474.  
  475.   VVVVaaaarrrriiiiaaaabbbblllleeee TTTTyyyyppppiiiinnnngggg AAAAnnnndddd CCCCoooonnnnvvvveeeerrrrssssiiiioooonnnn
  476.      Variables and fields may be  (floating  point)  numbers,  or
  477.      strings, or both. How the value of a variable is interpreted
  478.      depends upon its context. If used in a  numeric  expression,
  479.      it  will be treated as a number, if used as a string it will
  480.      be treated as a string.
  481.  
  482.      To force a variable to be treated as a number, add 0 to  it;
  483.      to  force  it to be treated as a string, concatenate it with
  484.      the null string.
  485.  
  486.      When a string must be converted to a number, the  conversion
  487.      is  accomplished  using _a_t_o_f(3).  A number is converted to a
  488.      string by using the value of CCCCOOOONNNNVVVVFFFFMMMMTTTT as a format string  for
  489.      _s_p_r_i_n_t_f(3),  with  the  numeric value of the variable as the
  490.      argument.  However, even  though  all  numbers  in  AWK  are
  491.      floating-point,  integral  values  are  _a_l_w_a_y_s  converted as
  492.      integers.  Thus, given
  493.  
  494.           CCCCOOOONNNNVVVVFFFFMMMMTTTT ==== """"%%%%2222....2222ffff""""
  495.           aaaa ==== 11112222
  496.           bbbb ==== aaaa """"""""
  497.  
  498.      the variable bbbb has a string value of """"11112222"""" and not """"11112222....00000000"""".
  499.  
  500.      _G_a_w_k performs comparisons as follows:  If two variables  are
  501.      numeric,  they  are  compared  numerically.  If one value is
  502.      numeric and the other has a string value that is a ``numeric
  503.      string,''  then comparisons are also done numerically.  Oth-
  504.      erwise, the numeric value is converted to  a  string  and  a
  505.      string  comparison  is performed.  Two strings are compared,
  506.      of course, as strings.  According  to  the  POSIX  standard,
  507.      even  if  two  strings  are  numeric strings, a numeric com-
  508.      parison is performed.  However, this is  clearly  incorrect,
  509.      and _g_a_w_k does not do this.
  510.  
  511.      Uninitialized variables have the numeric  value  0  and  the
  512.      string value "" (the null, or empty, string).
  513.  
  514. PPPPAAAATTTTTTTTEEEERRRRNNNNSSSS AAAANNNNDDDD AAAACCCCTTTTIIIIOOOONNNNSSSS
  515.      AWK is a line oriented language. The  pattern  comes  first,
  516.      and then the action. Action statements are enclosed in {{{{ and
  517.      }}}}.  Either the pattern may be missing, or the action may  be
  518.      missing,  but,  of course, not both. If the pattern is miss-
  519.      ing, the action will be executed for every  single  line  of
  520.  
  521.  
  522.  
  523. Free Software FoundationLast change: Apr 18 1994                   8
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530. GAWK(1)                 Utility Commands                  GAWK(1)
  531.  
  532.  
  533.  
  534.      input.  A missing action is equivalent to
  535.  
  536.           {{{{ pppprrrriiiinnnntttt }}}}
  537.  
  538.      which prints the entire line.
  539.  
  540.      Comments begin with the ``#'' character, and continue  until
  541.      the  end  of  the line.  Blank lines may be used to separate
  542.      statements.  Normally, a statement ends with a newline, how-
  543.      ever,  this  is  not  the  case for lines ending in a ``,'',
  544.      ``{'', ``?'', ``:'', ``&&'', or ``||''.  Lines ending in  ddddoooo
  545.      or  eeeellllsssseeee  also have their statements automatically continued
  546.      on the following line.  In other cases, a line can  be  con-
  547.      tinued  by ending it with a ``\'', in which case the newline
  548.      will be ignored.
  549.  
  550.      Multiple statements may be put on  one  line  by  separating
  551.      them  with  a  ``;''.   This  applies to both the statements
  552.      within the action part of a pattern-action pair  (the  usual
  553.      case), and to the pattern-action statements themselves.
  554.  
  555.   PPPPaaaatttttttteeeerrrrnnnnssss
  556.      AWK patterns may be one of the following:
  557.  
  558.           BBBBEEEEGGGGIIIINNNN
  559.           EEEENNNNDDDD
  560.           ////_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n////
  561.           _r_e_l_a_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n
  562.           _p_a_t_t_e_r_n &&&&&&&& _p_a_t_t_e_r_n
  563.           _p_a_t_t_e_r_n |||||||| _p_a_t_t_e_r_n
  564.           _p_a_t_t_e_r_n ???? _p_a_t_t_e_r_n :::: _p_a_t_t_e_r_n
  565.           ((((_p_a_t_t_e_r_n))))
  566.           !!!! _p_a_t_t_e_r_n
  567.           _p_a_t_t_e_r_n_1,,,, _p_a_t_t_e_r_n_2
  568.  
  569.      BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD are two special kinds of  patterns  which  are
  570.      not tested against the input.  The action parts of all BBBBEEEEGGGGIIIINNNN
  571.      patterns are merged as if all the statements had been  writ-
  572.      ten in a single BBBBEEEEGGGGIIIINNNN block. They are executed before any of
  573.      the input is read. Similarly, all the EEEENNNNDDDD blocks are merged,
  574.      and  executed  when  all  the input is exhausted (or when an
  575.      eeeexxxxiiiitttt statement is executed).  BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD patterns  cannot
  576.      be  combined  with  other  patterns  in pattern expressions.
  577.      BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD patterns cannot have missing action parts.
  578.  
  579.      For ////_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n//// patterns, the associated  statement
  580.      is  executed  for  each  input line that matches the regular
  581.      expression.  Regular expressions are the same  as  those  in
  582.      _e_g_r_e_p(1), and are summarized below.
  583.  
  584.      A _r_e_l_a_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n may use any of the operators defined
  585.      below  in  the  section  on  actions.   These generally test
  586.  
  587.  
  588.  
  589. Free Software FoundationLast change: Apr 18 1994                   9
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596. GAWK(1)                 Utility Commands                  GAWK(1)
  597.  
  598.  
  599.  
  600.      whether certain fields match certain regular expressions.
  601.  
  602.      The &&&&&&&&, ||||||||, and !!!! operators are logical AND, logical OR, and
  603.      logical  NOT,  respectively, as in C.  They do short-circuit
  604.      evaluation, also as in C, and are used  for  combining  more
  605.      primitive   pattern   expressions.  As  in  most  languages,
  606.      parentheses may be used to change the order of evaluation.
  607.  
  608.      The ????:::: operator is like the same operator in C. If the first
  609.      pattern  is  true  then  the pattern used for testing is the
  610.      second pattern, otherwise it is the third. Only one  of  the
  611.      second and third patterns is evaluated.
  612.  
  613.      The _p_a_t_t_e_r_n_1,,,, _p_a_t_t_e_r_n_2 form of an  expression  is  called  a
  614.      _r_a_n_g_e _p_a_t_t_e_r_n.  It matches all input records starting with a
  615.      line that matches _p_a_t_t_e_r_n_1, and continuing  until  a  record
  616.      that  matches  _p_a_t_t_e_r_n_2, inclusive. It does not combine with
  617.      any other sort of pattern expression.
  618.  
  619.   RRRReeeegggguuuullllaaaarrrr EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss
  620.      Regular expressions are the extended kind  found  in  _e_g_r_e_p.
  621.      They are composed of characters as follows:
  622.  
  623.      _c          matches the non-metacharacter _c.
  624.  
  625.      \_c         matches the literal character _c.
  626.  
  627.      ....          matches any character except newline.
  628.  
  629.      ^^^^          matches the beginning of a line or a string.
  630.  
  631.      $$$$          matches the end of a line or a string.
  632.  
  633.      [[[[_a_b_c...]]]]   character class, matches any  of  the  characters
  634.                 _a_b_c....
  635.  
  636.      [[[[^^^^_a_b_c...]]]]  negated character class,  matches  any  character
  637.                 except _a_b_c... and newline.
  638.  
  639.      _r_1||||_r_2      alternation: matches either _r_1 or _r_2.
  640.  
  641.      _r_1_r_2       concatenation: matches _r_1, and then _r_2.
  642.  
  643.      _r++++         matches one or more _r's.
  644.  
  645.      _r****         matches zero or more _r's.
  646.  
  647.      _r????         matches zero or one _r's.
  648.  
  649.      ((((_r))))        grouping: matches _r.
  650.  
  651.  
  652.  
  653.  
  654.  
  655. Free Software FoundationLast change: Apr 18 1994                  10
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662. GAWK(1)                 Utility Commands                  GAWK(1)
  663.  
  664.  
  665.  
  666.      The escape sequences that are valid in string constants (see
  667.      below) are also legal in regular expressions.
  668.  
  669.   AAAAccccttttiiiioooonnnnssss
  670.      Action statements are enclosed in braces, {{{{ and  }}}}.   Action
  671.      statements consist of the usual assignment, conditional, and
  672.      looping statements found in most languages.  The  operators,
  673.      control  statements,  and  input/output statements available
  674.      are patterned after those in C.
  675.  
  676.   OOOOppppeeeerrrraaaattttoooorrrrssss
  677.      The operators in AWK, in order of increasing precedence, are
  678.  
  679.      ==== ++++==== ----====
  680.      ****==== ////==== %%%%==== ^^^^==== Assignment.  Both  absolute  assignment  ((((_v_a_r  ====
  681.                  _v_a_l_u_e)))) and operator-assignment (the other forms)
  682.                  are supported.
  683.  
  684.      ????::::          The C conditional expression. This has the  form
  685.                  _e_x_p_r_1  ????  _e_x_p_r_2  ::::  _e_x_p_r_3. If _e_x_p_r_1 is true, the
  686.                  value of the expression is _e_x_p_r_2,  otherwise  it
  687.                  is  _e_x_p_r_3.   Only  one  of  _e_x_p_r_2  and  _e_x_p_r_3 is
  688.                  evaluated.
  689.  
  690.      ||||||||          Logical OR.
  691.  
  692.      &&&&&&&&          Logical AND.
  693.  
  694.      ~~~~ !!!!~~~~        Regular expression match, negated match.   NNNNOOOOTTTTEEEE::::
  695.                  Do not use a constant regular expression (////ffffoooooooo////)
  696.                  on the left-hand side of a ~~~~ or  !!!!~~~~.   Only  use
  697.                  one  on  the  right-hand  side.   The expression
  698.                  ////ffffoooooooo//// ~~~~ _e_x_p has  the  same  meaning  as  (((((((($$$$0000  ~~~~
  699.                  ////ffffoooooooo////))))  ~~~~  _e_x_p)))).   This  is usually _n_o_t what was
  700.                  intended.
  701.  
  702.      <<<< >>>>
  703.      <<<<==== >>>>====
  704.      !!!!==== ========       The regular relational operators.
  705.  
  706.      _b_l_a_n_k       String concatenation.
  707.  
  708.      ++++ ----          Addition and subtraction.
  709.  
  710.      **** //// %%%%       Multiplication, division, and modulus.
  711.  
  712.      ++++ ---- !!!!        Unary plus, unary minus, and logical negation.
  713.  
  714.      ^^^^           Exponentiation (******** may also be used, and ********==== for
  715.                  the assignment operator).
  716.  
  717.      ++++++++ ---- ----         Increment  and  decrement,  both  prefix  and
  718.  
  719.  
  720.  
  721. Free Software FoundationLast change: Apr 18 1994                  11
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728. GAWK(1)                 Utility Commands                  GAWK(1)
  729.  
  730.  
  731.  
  732.                  postfix.
  733.  
  734.      $$$$           Field reference.
  735.  
  736.   CCCCoooonnnnttttrrrroooollll SSSSttttaaaatttteeeemmmmeeeennnnttttssss
  737.      The control statements are as follows:
  738.  
  739.           iiiiffff ((((_c_o_n_d_i_t_i_o_n)))) _s_t_a_t_e_m_e_n_t [ eeeellllsssseeee _s_t_a_t_e_m_e_n_t ]
  740.           wwwwhhhhiiiilllleeee ((((_c_o_n_d_i_t_i_o_n)))) _s_t_a_t_e_m_e_n_t
  741.           ddddoooo _s_t_a_t_e_m_e_n_t wwwwhhhhiiiilllleeee ((((_c_o_n_d_i_t_i_o_n))))
  742.           ffffoooorrrr ((((_e_x_p_r_1;;;; _e_x_p_r_2;;;; _e_x_p_r_3)))) _s_t_a_t_e_m_e_n_t
  743.           ffffoooorrrr ((((_v_a_r iiiinnnn _a_r_r_a_y)))) _s_t_a_t_e_m_e_n_t
  744.           bbbbrrrreeeeaaaakkkk
  745.           ccccoooonnnnttttiiiinnnnuuuueeee
  746.           ddddeeeelllleeeetttteeee _a_r_r_a_y[[[[_i_n_d_e_x]]]]
  747.           ddddeeeelllleeeetttteeee _a_r_r_a_y
  748.           eeeexxxxiiiitttt [ _e_x_p_r_e_s_s_i_o_n ]
  749.           {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  750.  
  751.   IIII////OOOO SSSSttttaaaatttteeeemmmmeeeennnnttttssss
  752.      The input/output statements are as follows:
  753.  
  754.      cccclllloooosssseeee((((_f_i_l_e_n_a_m_e))))       Close file (or pipe, see below).
  755.  
  756.      ggggeeeettttlllliiiinnnneeee               Set $$$$0000 from next input record; set NNNNFFFF,
  757.                            NNNNRRRR, FFFFNNNNRRRR.
  758.  
  759.      ggggeeeettttlllliiiinnnneeee <<<<_f_i_l_e         Set $$$$0000 from next record of  _f_i_l_e;  set
  760.                            NNNNFFFF.
  761.  
  762.      ggggeeeettttlllliiiinnnneeee _v_a_r           Set _v_a_r from next  input  record;  set
  763.                            NNNNFFFF, FFFFNNNNRRRR.
  764.  
  765.      ggggeeeettttlllliiiinnnneeee _v_a_r <<<<_f_i_l_e     Set _v_a_r from next record of _f_i_l_e.
  766.  
  767.      nnnneeeexxxxtttt                  Stop  processing  the  current   input
  768.                            record.  The next input record is read
  769.                            and processing starts  over  with  the
  770.                            first  pattern  in the AWK program. If
  771.                            the end of the input data is  reached,
  772.                            the  EEEENNNNDDDD  block(s),  if  any, are exe-
  773.                            cuted.
  774.  
  775.      nnnneeeexxxxtttt ffffiiiilllleeee             Stop  processing  the  current   input
  776.                            file.   The  next  input  record  read
  777.                            comes  from  the  next   input   file.
  778.                            FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE  is  updated, FFFFNNNNRRRR is reset to
  779.                            1, and processing starts over with the
  780.                            first  pattern  in the AWK program. If
  781.                            the end of the input data is  reached,
  782.                            the  EEEENNNNDDDD  block(s),  if  any, are exe-
  783.                            cuted.
  784.  
  785.  
  786.  
  787. Free Software FoundationLast change: Apr 18 1994                  12
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794. GAWK(1)                 Utility Commands                  GAWK(1)
  795.  
  796.  
  797.  
  798.      pppprrrriiiinnnntttt                 Prints the current record.
  799.  
  800.      pppprrrriiiinnnntttt _e_x_p_r-_l_i_s_t       Prints expressions.   Each  expression
  801.                            is  separated  by the value of the OOOOFFFFSSSS
  802.                            variable. The output  record  is  ter-
  803.                            minated  with  the  value  of  the OOOORRRRSSSS
  804.                            variable.
  805.  
  806.      pppprrrriiiinnnntttt _e_x_p_r-_l_i_s_t >>>>_f_i_l_e Prints  expressions  on  _f_i_l_e.    Each
  807.                            expression  is  separated by the value
  808.                            of the OOOOFFFFSSSS variable. The output record
  809.                            is  terminated  with  the value of the
  810.                            OOOORRRRSSSS variable.
  811.  
  812.      pppprrrriiiinnnnttttffff _f_m_t, _e_x_p_r-_l_i_s_t Format and print.
  813.  
  814.      pppprrrriiiinnnnttttffff _f_m_t, _e_x_p_r-_l_i_s_t >>>>_f_i_l_e
  815.                            Format and print on _f_i_l_e.
  816.  
  817.      ssssyyyysssstttteeeemmmm((((_c_m_d-_l_i_n_e))))      Execute  the  command  _c_m_d-_l_i_n_e,   and
  818.                            return the exit status.  (This may not
  819.                            be available on non-POSIX systems.)
  820.  
  821.      Other input/output redirections are also allowed. For  pppprrrriiiinnnntttt
  822.      and  pppprrrriiiinnnnttttffff, >>>>>>>>_f_i_l_e appends output to the _f_i_l_e, while |||| _c_o_m_-
  823.      _m_a_n_d writes on a pipe.  In a similar fashion, _c_o_m_m_a_n_d |||| ggggeeeetttt----
  824.      lllliiiinnnneeee  pipes into ggggeeeettttlllliiiinnnneeee.  The ggggeeeettttlllliiiinnnneeee command will return 0
  825.      on end of file, and -1 on an error.
  826.  
  827.   TTTThhhheeee _p_r_i_n_t_f SSSSttttaaaatttteeeemmmmeeeennnntttt
  828.      The AWK versions of the pppprrrriiiinnnnttttffff statement and sssspppprrrriiiinnnnttttffff(((()))) func-
  829.      tion  (see below) accept the following conversion specifica-
  830.      tion formats:
  831.  
  832.      %%%%cccc   An ASCII character.  If the argument  used  for  %%%%cccc  is
  833.           numeric,  it  is  treated  as  a character and printed.
  834.           Otherwise, the argument is assumed to be a string,  and
  835.           the only first character of that string is printed.
  836.  
  837.      %%%%dddd   A decimal number (the integer part).
  838.  
  839.      %%%%iiii   Just like %%%%dddd.
  840.  
  841.      %%%%eeee   A floating point number of the form [[[[----]]]]dddd....ddddddddddddddddddddddddEEEE[[[[++++----]]]]dddddddd.
  842.  
  843.      %%%%ffff   A floating point number of the form [[[[----]]]]dddddddddddd....dddddddddddddddddddddddd.
  844.  
  845.      %%%%gggg   Use eeee or ffff conversion, whichever is shorter, with  non-
  846.           significant zeros suppressed.
  847.  
  848.      %%%%oooo   An unsigned octal number (again, an integer).
  849.  
  850.  
  851.  
  852.  
  853. Free Software FoundationLast change: Apr 18 1994                  13
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860. GAWK(1)                 Utility Commands                  GAWK(1)
  861.  
  862.  
  863.  
  864.      %%%%ssss   A character string.
  865.  
  866.      %%%%xxxx   An unsigned hexadecimal number (an integer).
  867.  
  868.      %%%%XXXX   Like %%%%xxxx, but using AAAABBBBCCCCDDDDEEEEFFFF instead of aaaabbbbccccddddeeeeffff.
  869.  
  870.      %%%%%%%%   A single %%%% character; no argument is converted.
  871.  
  872.      There are  optional,  additional  parameters  that  may  lie
  873.      between the %%%% and the control letter:
  874.  
  875.      ----     The expression should  be  left-justified  within  its
  876.           field.
  877.  
  878.      _w_i_d_t_h
  879.           The field should be padded to this width. If the number
  880.           has  a leading zero, then the field will be padded with
  881.           zeros.  Otherwise  it  is  padded  with  blanks.   This
  882.           applies even to the non-numeric output formats.
  883.  
  884.      ...._p_r_e_c
  885.           A number indicating the maximum  width  of  strings  or
  886.           digits to the right of the decimal point.
  887.  
  888.      The dynamic _w_i_d_t_h  and  _p_r_e_c  capabilities  of  the  ANSI  C
  889.      pppprrrriiiinnnnttttffff(((()))) routines are supported.  A **** in place of either the
  890.      wwwwiiiiddddtttthhhh or pppprrrreeeecccc specifications will cause their values  to  be
  891.      taken from the argument list to pppprrrriiiinnnnttttffff or sssspppprrrriiiinnnnttttffff(((()))).
  892.  
  893.   SSSSppppeeeecccciiiiaaaallll FFFFiiiilllleeee NNNNaaaammmmeeeessss
  894.      When doing I/O redirection from either pppprrrriiiinnnntttt or pppprrrriiiinnnnttttffff  into
  895.      a  file, or via ggggeeeettttlllliiiinnnneeee from a file, _g_a_w_k recognizes certain
  896.      special filenames internally.  These filenames allow  access
  897.      to  open  file descriptors inherited from _g_a_w_k's parent pro-
  898.      cess (usually the shell).  Other special  filenames  provide
  899.      access  information  about  the  running  ggggaaaawwwwkkkk process.  The
  900.      filenames are:
  901.  
  902.      ////ddddeeeevvvv////ppppiiiidddd    Reading this file returns the process ID of  the
  903.                  current  process,  in decimal, terminated with a
  904.                  newline.
  905.  
  906.      ////ddddeeeevvvv////ppppppppiiiidddd   Reading this file returns the parent process  ID
  907.                  of  the  current process, in decimal, terminated
  908.                  with a newline.
  909.  
  910.      ////ddddeeeevvvv////ppppggggrrrrppppiiiidddd Reading this file returns the process  group  ID
  911.                  of  the  current process, in decimal, terminated
  912.                  with a newline.
  913.  
  914.      ////ddddeeeevvvv////uuuusssseeeerrrr   Reading this file returns a single  record  ter-
  915.                  minated   with   a   newline.   The  fields  are
  916.  
  917.  
  918.  
  919. Free Software FoundationLast change: Apr 18 1994                  14
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926. GAWK(1)                 Utility Commands                  GAWK(1)
  927.  
  928.  
  929.  
  930.                  separated with blanks.  $$$$1111 is the value  of  the
  931.                  _g_e_t_u_i_d(2)  system  call,  $$$$2222 is the value of the
  932.                  _g_e_t_e_u_i_d(2) system call, $$$$3333 is the value  of  the
  933.                  _g_e_t_g_i_d(2)  system  call,  and $$$$4444 is the value of
  934.                  the _g_e_t_e_g_i_d(2) system call.  If  there  are  any
  935.                  additional   fields,  they  are  the  group  IDs
  936.                  returned by _g_e_t_g_r_o_u_p_s(2).  Multiple  groups  may
  937.                  not be supported on all systems.
  938.  
  939.      ////ddddeeeevvvv////ssssttttddddiiiinnnn  The standard input.
  940.  
  941.      ////ddddeeeevvvv////ssssttttddddoooouuuutttt The standard output.
  942.  
  943.      ////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr The standard error output.
  944.  
  945.      ////ddddeeeevvvv////ffffdddd////_n   The file associated with the open file  descrip-
  946.                  tor _n.
  947.  
  948.      These are particularly useful for error messages. For  exam-
  949.      ple:
  950.  
  951.           pppprrrriiiinnnntttt """"YYYYoooouuuu bbbblllleeeewwww iiiitttt!!!!"""" >>>> """"////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr""""
  952.  
  953.      whereas you would otherwise have to use
  954.  
  955.           pppprrrriiiinnnntttt """"YYYYoooouuuu bbbblllleeeewwww iiiitttt!!!!"""" |||| """"ccccaaaatttt 1111>>>>&&&&2222""""
  956.  
  957.      These file names may also be used on  the  command  line  to
  958.      name data files.
  959.  
  960.   NNNNuuuummmmeeeerrrriiiicccc FFFFuuuunnnnccccttttiiiioooonnnnssss
  961.      AWK has the following pre-defined arithmetic functions:
  962.  
  963.      aaaattttaaaannnn2222((((_y,,,, _x)))) returns the arctangent of _y/_x in radians.
  964.  
  965.      ccccoooossss((((_e_x_p_r))))   returns the cosine in radians.
  966.  
  967.      eeeexxxxpppp((((_e_x_p_r))))   the exponential function.
  968.  
  969.      iiiinnnntttt((((_e_x_p_r))))   truncates to integer.
  970.  
  971.      lllloooogggg((((_e_x_p_r))))   the natural logarithm function.
  972.  
  973.      rrrraaaannnndddd(((())))      returns a random number between 0 and 1.
  974.  
  975.      ssssiiiinnnn((((_e_x_p_r))))   returns the sine in radians.
  976.  
  977.      ssssqqqqrrrrtttt((((_e_x_p_r))))  the square root function.
  978.  
  979.      ssssrrrraaaannnndddd((((_e_x_p_r)))) use _e_x_p_r as a new seed  for  the  random  number
  980.                  generator.  If  no _e_x_p_r is provided, the time of
  981.                  day will be  used.   The  return  value  is  the
  982.  
  983.  
  984.  
  985. Free Software FoundationLast change: Apr 18 1994                  15
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992. GAWK(1)                 Utility Commands                  GAWK(1)
  993.  
  994.  
  995.  
  996.                  previous seed for the random number generator.
  997.  
  998.   SSSSttttrrrriiiinnnngggg FFFFuuuunnnnccccttttiiiioooonnnnssss
  999.      AWK has the following pre-defined string functions:
  1000.  
  1001.      ggggssssuuuubbbb((((_r,,,, _s,,,, _t))))           for each substring matching the reg-
  1002.                              ular  expression  _r in the string _t,
  1003.                              substitute the string _s, and  return
  1004.                              the  number  of substitutions.  If _t
  1005.                              is not supplied, use $$$$0000.
  1006.  
  1007.      iiiinnnnddddeeeexxxx((((_s,,,, _t))))             returns the index of the string _t in
  1008.                              the  string  _s,  or  0  if  _t is not
  1009.                              present.
  1010.  
  1011.      lllleeeennnnggggtttthhhh((((_s))))               returns the length of the string  _s,
  1012.                              or the length of $$$$0000 if _s is not sup-
  1013.                              plied.
  1014.  
  1015.      mmmmaaaattttcccchhhh((((_s,,,, _r))))             returns the position in _s where  the
  1016.                              regular expression _r occurs, or 0 if
  1017.                              _r  is  not  present,  and  sets  the
  1018.                              values of RRRRSSSSTTTTAAAARRRRTTTT and RRRRLLLLEEEENNNNGGGGTTTTHHHH.
  1019.  
  1020.      sssspppplllliiiitttt((((_s,,,, _a,,,, _r))))          splits the string _s into the array _a
  1021.                              on  the  regular  expression  _r, and
  1022.                              returns the number of fields.  If  _r
  1023.                              is omitted, FFFFSSSS is used instead.  The
  1024.                              array _a is cleared first.
  1025.  
  1026.      sssspppprrrriiiinnnnttttffff((((_f_m_t,,,, _e_x_p_r-_l_i_s_t)))) prints _e_x_p_r-_l_i_s_t according  to  _f_m_t,
  1027.                              and returns the resulting string.
  1028.  
  1029.      ssssuuuubbbb((((_r,,,, _s,,,, _t))))            just like ggggssssuuuubbbb(((()))), but only the first
  1030.                              matching substring is replaced.
  1031.  
  1032.      ssssuuuubbbbssssttttrrrr((((_s,,,, _i,,,, _n))))         returns the _n-character substring of
  1033.                              _s  starting  at _i.  If _n is omitted,
  1034.                              the rest of _s is used.
  1035.  
  1036.      ttttoooolllloooowwwweeeerrrr((((_s_t_r))))            returns a copy of  the  string  _s_t_r,
  1037.                              with  all  the upper-case characters
  1038.                              in   _s_t_r   translated    to    their
  1039.                              corresponding   lower-case  counter-
  1040.                              parts.   Non-alphabetic   characters
  1041.                              are left unchanged.
  1042.  
  1043.      ttttoooouuuuppppppppeeeerrrr((((_s_t_r))))            returns a copy of  the  string  _s_t_r,
  1044.                              with  all  the lower-case characters
  1045.                              in   _s_t_r   translated    to    their
  1046.                              corresponding   upper-case  counter-
  1047.                              parts.   Non-alphabetic   characters
  1048.  
  1049.  
  1050.  
  1051. Free Software FoundationLast change: Apr 18 1994                  16
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058. GAWK(1)                 Utility Commands                  GAWK(1)
  1059.  
  1060.  
  1061.  
  1062.                              are left unchanged.
  1063.  
  1064.   TTTTiiiimmmmeeee FFFFuuuunnnnccccttttiiiioooonnnnssss
  1065.      Since one of the primary uses of AWK programs is  processing
  1066.      log files that contain time stamp information, _g_a_w_k provides
  1067.      the following two functions for obtaining  time  stamps  and
  1068.      formatting them.
  1069.  
  1070.      ssssyyyyssssttttiiiimmmmeeee(((()))) returns the current time of day as the  number  of
  1071.                seconds  since the Epoch (Midnight UTC, January 1,
  1072.                1970 on POSIX systems).
  1073.  
  1074.      ssssttttrrrrffffttttiiiimmmmeeee((((_f_o_r_m_a_t, _t_i_m_e_s_t_a_m_p))))
  1075.                formats _t_i_m_e_s_t_a_m_p according to  the  specification
  1076.                in  _f_o_r_m_a_t.   The  _t_i_m_e_s_t_a_m_p should be of the same
  1077.                form as returned by ssssyyyyssssttttiiiimmmmeeee(((()))).   If  _t_i_m_e_s_t_a_m_p  is
  1078.                missing, the current time of day is used.  See the
  1079.                specification for the ssssttttrrrrffffttttiiiimmmmeeee(((()))) function in  ANSI
  1080.                C  for  the format conversions that are guaranteed
  1081.                to  be  available.   A  public-domain  version  of
  1082.                _s_t_r_f_t_i_m_e(3) and a man page for it are shipped with
  1083.                _g_a_w_k; if that version was used to build _g_a_w_k, then
  1084.                all  of the conversions described in that man page
  1085.                are available to _g_a_w_k.
  1086.  
  1087.   SSSSttttrrrriiiinnnngggg CCCCoooonnnnssssttttaaaannnnttttssss
  1088.      String constants in AWK are sequences of characters enclosed
  1089.      between  double  quotes  (""""). Within strings, certain _e_s_c_a_p_e
  1090.      _s_e_q_u_e_n_c_e_s are recognized, as in C. These are:
  1091.  
  1092.      \\\\\\\\   A literal backslash.
  1093.  
  1094.      \\\\aaaa   The ``alert'' character; usually the ASCII BEL  charac-
  1095.           ter.
  1096.  
  1097.      \\\\bbbb   backspace.
  1098.  
  1099.      \\\\ffff   form-feed.
  1100.  
  1101.      \\\\nnnn   new line.
  1102.  
  1103.      \\\\rrrr   carriage return.
  1104.  
  1105.      \\\\tttt   horizontal tab.
  1106.  
  1107.      \\\\vvvv   vertical tab.
  1108.  
  1109.      \\\\xxxx_h_e_x _d_i_g_i_t_s
  1110.           The character represented by the string of  hexadecimal
  1111.           digits  following  the \\\\xxxx.  As in ANSI C, all following
  1112.           hexadecimal digits are considered part  of  the  escape
  1113.           sequence.  (This feature should tell us something about
  1114.  
  1115.  
  1116.  
  1117. Free Software FoundationLast change: Apr 18 1994                  17
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124. GAWK(1)                 Utility Commands                  GAWK(1)
  1125.  
  1126.  
  1127.  
  1128.           language design by committee.)   E.g.,  """"\\\\xxxx1111BBBB""""  is  the
  1129.           ASCII ESC (escape) character.
  1130.  
  1131.      \\\\_d_d_d The character represented by the  1-,  2-,  or  3-digit
  1132.           sequence  of octal digits. E.g. """"\\\\000033333333"""" is the ASCII ESC
  1133.           (escape) character.
  1134.  
  1135.      \\\\_c   The literal character _c.
  1136.  
  1137.      The escape sequences may also be used inside constant  regu-
  1138.      lar  expressions  (e.g.,  ////[[[[ \\\\tttt\\\\ffff\\\\nnnn\\\\rrrr\\\\vvvv]]]]//// matches whitespace
  1139.      characters).
  1140.  
  1141. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  1142.      Functions in AWK are defined as follows:
  1143.  
  1144.           ffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e((((_p_a_r_a_m_e_t_e_r _l_i_s_t)))) {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  1145.  
  1146.      Functions are executed when called from  within  the  action
  1147.      parts  of  regular pattern-action statements. Actual parame-
  1148.      ters supplied in the function call are used  to  instantiate
  1149.      the  formal parameters declared in the function.  Arrays are
  1150.      passed by reference, other variables are passed by value.
  1151.  
  1152.      Since  functions  were  not  originally  part  of  the   AWK
  1153.      language,  the  provision  for  local  variables  is  rather
  1154.      clumsy: They are declared as extra parameters in the parame-
  1155.      ter list. The convention is to separate local variables from
  1156.      real parameters by extra spaces in the parameter  list.  For
  1157.      example:
  1158.  
  1159.           ffffuuuunnnnccccttttiiiioooonnnn  ffff((((pppp,,,, qqqq,,,,     aaaa,,,, bbbb)))) {{{{ #### aaaa &&&& bbbb aaaarrrreeee llllooooccccaaaallll
  1160.                          .................... }}}}
  1161.  
  1162.           ////aaaabbbbcccc////     {{{{ ............ ;;;; ffff((((1111,,,, 2222)))) ;;;; ............ }}}}
  1163.  
  1164.      The left parenthesis in  a  function  call  is  required  to
  1165.      immediately  follow the function name, without any interven-
  1166.      ing white space.  This is to  avoid  a  syntactic  ambiguity
  1167.      with  the concatenation operator.  This restriction does not
  1168.      apply to the built-in functions listed above.
  1169.  
  1170.      Functions may call each other and may be  recursive.   Func-
  1171.      tion  parameters  used as local variables are initialized to
  1172.      the null string and the number zero  upon  function  invoca-
  1173.      tion.
  1174.  
  1175.      The word ffffuuuunnnncccc may be used in place of ffffuuuunnnnccccttttiiiioooonnnn.
  1176.  
  1177. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  1178.      Print and sort the login names of all users:
  1179.  
  1180.  
  1181.  
  1182.  
  1183. Free Software FoundationLast change: Apr 18 1994                  18
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190. GAWK(1)                 Utility Commands                  GAWK(1)
  1191.  
  1192.  
  1193.  
  1194.           BBBBEEEEGGGGIIIINNNN     {{{{ FFFFSSSS ==== """"::::"""" }}}}
  1195.                {{{{ pppprrrriiiinnnntttt $$$$1111 |||| """"ssssoooorrrrtttt"""" }}}}
  1196.  
  1197.      Count lines in a file:
  1198.  
  1199.                {{{{ nnnnlllliiiinnnneeeessss++++++++ }}}}
  1200.           EEEENNNNDDDD  {{{{ pppprrrriiiinnnntttt nnnnlllliiiinnnneeeessss }}}}
  1201.  
  1202.      Precede each line by its number in the file:
  1203.  
  1204.           {{{{ pppprrrriiiinnnntttt FFFFNNNNRRRR,,,, $$$$0000 }}}}
  1205.  
  1206.      Concatenate and line number (a variation on a theme):
  1207.  
  1208.           {{{{ pppprrrriiiinnnntttt NNNNRRRR,,,, $$$$0000 }}}}
  1209.  
  1210. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1211.      _e_g_r_e_p(1),  _g_e_t_p_i_d(2),  _g_e_t_p_p_i_d(2),  _g_e_t_p_g_r_p(2),   _g_e_t_u_i_d(2),
  1212.      _g_e_t_e_u_i_d(2), _g_e_t_g_i_d(2), _g_e_t_e_g_i_d(2), _g_e_t_g_r_o_u_p_s(2)
  1213.  
  1214.      _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, Alfred V. Aho, Brian  W.  Ker-
  1215.      nighan,  Peter  J. Weinberger, Addison-Wesley, 1988. ISBN 0-
  1216.      201-07981-X.
  1217.  
  1218.      _T_h_e  _G_A_W_K  _M_a_n_u_a_l,  Edition  0.15,  published  by  the  Free
  1219.      Software Foundation, 1993.
  1220.  
  1221. PPPPOOOOSSSSIIIIXXXX CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY
  1222.      A primary goal for _g_a_w_k  is  compatibility  with  the  POSIX
  1223.      standard,  as  well  as with the latest version of UNIX _a_w_k.
  1224.      To this end, _g_a_w_k incorporates the  following  user  visible
  1225.      features  which  are  not described in the AWK book, but are
  1226.      part of _a_w_k in System V Release 4,  and  are  in  the  POSIX
  1227.      standard.
  1228.  
  1229.      The ----vvvv option for assigning variables before program  execu-
  1230.      tion  starts  is  new.  The book indicates that command line
  1231.      variable assignment happens when _a_w_k  would  otherwise  open
  1232.      the  argument  as  a file, which is after the BBBBEEEEGGGGIIIINNNN block is
  1233.      executed.  However, in earlier implementations, when such an
  1234.      assignment  appeared  before  any file names, the assignment
  1235.      would happen _b_e_f_o_r_e the BBBBEEEEGGGGIIIINNNN block was  run.   Applications
  1236.      came to depend on this ``feature.''  When _a_w_k was changed to
  1237.      match its documentation, this option was added  to  accommo-
  1238.      date  applications  that  depended  upon  the  old behavior.
  1239.      (This feature was agreed upon  by  both  the  AT&T  and  GNU
  1240.      developers.)
  1241.  
  1242.      The ----WWWW option for implementation specific features  is  from
  1243.      the POSIX standard.
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249. Free Software FoundationLast change: Apr 18 1994                  19
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256. GAWK(1)                 Utility Commands                  GAWK(1)
  1257.  
  1258.  
  1259.  
  1260.      When processing arguments, _g_a_w_k uses the special option ``--------
  1261.      ''  to  signal the end of arguments.  In compatibility mode,
  1262.      it will warn about, but otherwise ignore, undefined options.
  1263.      In normal operation, such arguments are passed on to the AWK
  1264.      program for it to process.
  1265.  
  1266.      The AWK book does not define the return  value  of  ssssrrrraaaannnndddd(((()))).
  1267.      The  System  V  Release 4 version of UNIX _a_w_k (and the POSIX
  1268.      standard) has it return the seed  it  was  using,  to  allow
  1269.      keeping  track of random number sequences. Therefore ssssrrrraaaannnndddd(((())))
  1270.      in _g_a_w_k also returns its current seed.
  1271.  
  1272.      Other new features are:  The use of  multiple   ---- ffff  options
  1273.      (from  MKS  _a_w_k);  the  EEEENNNNVVVVIIIIRRRROOOONNNN array; the \\\\aaaa, and \\\\vvvv escape
  1274.      sequences  (done  originally  in  _g_a_w_k  and  fed  back  into
  1275.      AT&T's);  the  ttttoooolllloooowwwweeeerrrr(((())))  and  ttttoooouuuuppppppppeeeerrrr(((())))  built-in functions
  1276.      (from AT&T); and the ANSI  C  conversion  specifications  in
  1277.      pppprrrriiiinnnnttttffff (done first in AT&T's version).
  1278.  
  1279. GGGGNNNNUUUU EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS
  1280.      _G_a_w_k has some extensions to POSIX _a_w_k.  They  are  described
  1281.      in  this  section.  All the extensions described here can be
  1282.      disabled by invoking _g_a_w_k with the ----WWWW ccccoooommmmppppaaaatttt option.
  1283.  
  1284.      The following features of _g_a_w_k are not  available  in  POSIX
  1285.      _a_w_k.
  1286.  
  1287.           +o  The \\\\xxxx escape sequence.
  1288.  
  1289.           +o  The ssssyyyyssssttttiiiimmmmeeee(((()))) and ssssttttrrrrffffttttiiiimmmmeeee(((()))) functions.
  1290.  
  1291.           +o  The special file names available for I/O redirection
  1292.             are not recognized.
  1293.  
  1294.           +o  The AAAARRRRGGGGIIIINNNNDDDD and EEEERRRRRRRRNNNNOOOO variables are not special.
  1295.  
  1296.           +o  The IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE variable and its side-effects are not
  1297.             available.
  1298.  
  1299.           +o  The  FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS  variable  and  fixed  width  field
  1300.             splitting.
  1301.  
  1302.           +o  No path search is performed for files named via the
  1303.             ---- ffff  option.  Therefore the AAAAWWWWKKKKPPPPAAAATTTTHHHH environment vari-
  1304.             able is not special.
  1305.  
  1306.           +o  The use of nnnneeeexxxxtttt ffffiiiilllleeee to abandon  processing  of  the
  1307.             current input file.
  1308.  
  1309.           +o  The use of ddddeeeelllleeeetttteeee _a_r_r_a_y to delete  the  entire  con-
  1310.             tents of an array.
  1311.  
  1312.  
  1313.  
  1314.  
  1315. Free Software FoundationLast change: Apr 18 1994                  20
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322. GAWK(1)                 Utility Commands                  GAWK(1)
  1323.  
  1324.  
  1325.  
  1326.      The AWK book does not define the return value of the cccclllloooosssseeee(((())))
  1327.      function.   _G_a_w_k's cccclllloooosssseeee(((()))) returns the value from _f_c_l_o_s_e(3),
  1328.      or _p_c_l_o_s_e(3), when closing a file or pipe, respectively.
  1329.  
  1330.      When _g_a_w_k is invoked with the ----WWWW ccccoooommmmppppaaaatttt option,  if  the  _f_s
  1331.      argument  to  the ----FFFF option is ``t'', then FFFFSSSS will be set to
  1332.      the tab character.  Since this  is  a  rather  ugly  special
  1333.      case,  it  is  not the default behavior.  This behavior also
  1334.      does not occur if ----WWWW ppppoooossssiiiixxxx has been specified.
  1335.  
  1336. HHHHIIIISSSSTTTTOOOORRRRIIIICCCCAAAALLLL FFFFEEEEAAAATTTTUUUURRRREEEESSSS
  1337.      There are two features  of  historical  AWK  implementations
  1338.      that  _g_a_w_k  supports.   First,  it  is  possible to call the
  1339.      lllleeeennnnggggtttthhhh(((()))) built-in function not only with  no  argument,  but
  1340.      even without parentheses!  Thus,
  1341.  
  1342.           aaaa ==== lllleeeennnnggggtttthhhh
  1343.  
  1344.      is the same as either of
  1345.  
  1346.           aaaa ==== lllleeeennnnggggtttthhhh(((())))
  1347.           aaaa ==== lllleeeennnnggggtttthhhh(((($$$$0000))))
  1348.  
  1349.      This feature is marked as ``deprecated'' in the POSIX  stan-
  1350.      dard, and _g_a_w_k will issue a warning about its use if ----WWWW lllliiiinnnntttt
  1351.      is specified on the command line.
  1352.  
  1353.      The other feature is the use of the ccccoooonnnnttttiiiinnnnuuuueeee statement  out-
  1354.      side  the body of a wwwwhhhhiiiilllleeee, ffffoooorrrr, or ddddoooo loop.  Traditional AWK
  1355.      implementations have treated such usage as equivalent to the
  1356.      nnnneeeexxxxtttt  statement.   _G_a_w_k  will support this usage if ----WWWW ppppoooossssiiiixxxx
  1357.      has not been specified.
  1358.  
  1359. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  1360.      If PPPPOOOOSSSSIIIIXXXXLLLLYYYY____CCCCOOOORRRRRRRREEEECCCCTTTT exists  in  the  environment,  then  _g_a_w_k
  1361.      behaves exactly as if --------ppppoooossssiiiixxxx had been specified on the com-
  1362.      mand line.  If --------lllliiiinnnntttt has been specified, _g_a_w_k will issue  a
  1363.      warning message to this effect.
  1364.  
  1365. BBBBUUUUGGGGSSSS
  1366.      The ----FFFF option is not necessary given the command line  vari-
  1367.      able  assignment feature; it remains only for backwards com-
  1368.      patibility.
  1369.  
  1370.      If your system actually has  support  for  ////ddddeeeevvvv////ffffdddd  and  the
  1371.      associated  ////ddddeeeevvvv////ssssttttddddiiiinnnn,  ////ddddeeeevvvv////ssssttttddddoooouuuutttt, and ////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr files,
  1372.      you may get different output from _g_a_w_k than you would get on
  1373.      a  system  without  those files.  When _g_a_w_k interprets these
  1374.      files internally, it synchronizes  output  to  the  standard
  1375.      output  with  output  to ////ddddeeeevvvv////ssssttttddddoooouuuutttt, while on a system with
  1376.      those files, the output is actually to different open files.
  1377.      Caveat Emptor.
  1378.  
  1379.  
  1380.  
  1381. Free Software FoundationLast change: Apr 18 1994                  21
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388. GAWK(1)                 Utility Commands                  GAWK(1)
  1389.  
  1390.  
  1391.  
  1392. VVVVEEEERRRRSSSSIIIIOOOONNNN IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  1393.      This man page documents _g_a_w_k, version 2.15.
  1394.  
  1395.      Starting with the 2.15 version of _g_a_w_k, the ----cccc, ----VVVV, ----CCCC, ---- aaaa,
  1396.      and ----eeee options of the 2.11 version are no longer recognized.
  1397.      This fact will not even be documented in the manual page for
  1398.      version 2.16.
  1399.  
  1400. AAAAUUUUTTTTHHHHOOOORRRRSSSS
  1401.      The original version of UNIX _a_w_k  was  designed  and  imple-
  1402.      mented  by Alfred Aho, Peter Weinberger, and Brian Kernighan
  1403.      of AT&T Bell Labs. Brian Kernighan continues to maintain and
  1404.      enhance it.
  1405.  
  1406.      Paul Rubin and Jay Fenlason, of the  Free  Software  Founda-
  1407.      tion, wrote _g_a_w_k, to be compatible with the original version
  1408.      of _a_w_k distributed in Seventh Edition UNIX.  John Woods con-
  1409.      tributed a number of bug fixes.  David Trueman, with contri-
  1410.      butions from Arnold Robbins, made _g_a_w_k compatible  with  the
  1411.      new version of UNIX _a_w_k.
  1412.  
  1413.      The initial DOS port was done by Conrad Kwok and Scott  Gar-
  1414.      finkle.   Scott  Deifik  is the current DOS maintainer.  Pat
  1415.      Rankin did the port to VMS, and Michal  Jaegermann  did  the
  1416.      port  to the Atari ST.  The port to OS/2 was done by Kai Uwe
  1417.      Rommel, with contributions and help from Darrel Hankerson.
  1418.  
  1419. AAAACCCCKKKKNNNNOOOOWWWWLLLLEEEEDDDDGGGGEEEEMMMMEEEENNNNTTTTSSSS
  1420.      Brian Kernighan of Bell Labs  provided  valuable  assistance
  1421.      during testing and debugging.  We thank him.
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447. Free Software FoundationLast change: Apr 18 1994                  22
  1448.  
  1449.  
  1450.  
  1451.